public class Rectangle {
	private Point p1, p2;
	private double width;
	private double height;
	private double area;
	private double diagonal;
	
	Rectangle(Point p1, Point p2) {
		this.p1 = p1;
		this.p2 = p2;				
	}
	
	public void setWidth(){
		this.width = Math.abs(p2.x - p1.x);
	}
	
	public void setHeight(){
		this.height = Math.abs(p2.y - p1.y); 
	}
	
	public void setArea(){
		this.area = this.width * this.height;
	}
	
	public void setDiagonal(){
		this.diagonal = Math.sqrt(Math.pow(this.width, 2) + Math.pow(this.height, 2));
	}
	
	
	public Double getWidth(){
		return width;
	}
	
	public Double getHeight(){
		return height;
	}
	
	public Double getArea() {
		return area;
	}
	
	public Double getDiagonal() {
		return diagonal;
	}
}
